~ubuntu-branches/ubuntu/trusty/monodevelop/trusty-proposed

« back to all changes in this revision

Viewing changes to external/ngit/NGit/NGit.Api/StashCreateCommand.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2013-05-12 09:46:03 UTC
  • mto: This revision was merged to the branch mainline in revision 29.
  • Revision ID: package-import@ubuntu.com-20130512094603-mad323bzcxvmcam0
Tags: upstream-4.0.5+dfsg
ImportĀ upstreamĀ versionĀ 4.0.5+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
using NGit.Api;
48
48
using NGit.Api.Errors;
49
49
using NGit.Dircache;
 
50
using NGit.Errors;
50
51
using NGit.Internal;
51
52
using NGit.Revwalk;
52
53
using NGit.Treewalk;
65
66
        /// </remarks>
66
67
        /// <seealso><a href="http://www.kernel.org/pub/software/scm/git/docs/git-stash.html"
67
68
        /// *      >Git documentation about Stash</a></seealso>
 
69
        /// <since>2.0</since>
68
70
        public class StashCreateCommand : GitCommand<RevCommit>
69
71
        {
70
72
                private static readonly string MSG_INDEX = "index on {0}: {1} {2}";
231
233
                /// and reset to the current HEAD commit.
232
234
                /// </remarks>
233
235
                /// <returns>stashed commit or null if no changes to stash</returns>
234
 
                /// <exception cref="NGit.Api.Errors.GitAPIException"></exception>
235
 
                /// <exception cref="NGit.Api.Errors.JGitInternalException"></exception>
 
236
                /// <exception cref="NGit.Api.Errors.GitAPIException">NGit.Api.Errors.GitAPIException
 
237
                ///     </exception>
236
238
                public override RevCommit Call()
237
239
                {
238
240
                        CheckCallable();
268
270
                                                WorkingTreeIterator wtIter = treeWalk.GetTree<WorkingTreeIterator>(2);
269
271
                                                if (headIter != null && indexIter != null && wtIter != null)
270
272
                                                {
 
273
                                                        if (!indexIter.GetDirCacheEntry().IsMerged())
 
274
                                                        {
 
275
                                                                throw new UnmergedPathsException(new UnmergedPathException(indexIter.GetDirCacheEntry
 
276
                                                                        ()));
 
277
                                                        }
271
278
                                                        if (wtIter.IdEqual(indexIter) || wtIter.IdEqual(headIter))
272
279
                                                        {
273
280
                                                                continue;
287
294
                                                        {
288
295
                                                                @in.Close();
289
296
                                                        }
290
 
                                                        wtEdits.AddItem(new _PathEdit_265(entry, entry));
 
297
                                                        wtEdits.AddItem(new _PathEdit_273(entry, entry));
291
298
                                                }
292
299
                                                else
293
300
                                                {
354
361
                        }
355
362
                }
356
363
 
357
 
                private sealed class _PathEdit_265 : DirCacheEditor.PathEdit
 
364
                private sealed class _PathEdit_273 : DirCacheEditor.PathEdit
358
365
                {
359
 
                        public _PathEdit_265(DirCacheEntry entry, DirCacheEntry baseArg1) : base(baseArg1
 
366
                        public _PathEdit_273(DirCacheEntry entry, DirCacheEntry baseArg1) : base(baseArg1
360
367
                                )
361
368
                        {
362
369
                                this.entry = entry;