Code

Merge branch 'maint'
authorJunio C Hamano <gitster@pobox.com>
Thu, 27 Jan 2011 18:27:49 +0000 (10:27 -0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 27 Jan 2011 18:27:49 +0000 (10:27 -0800)
* maint:
  rebase -i: clarify in-editor documentation of "exec"
  tests: sanitize more git environment variables
  fast-import: treat filemodify with empty tree as delete
  rebase: give a better error message for bogus branch
  rebase: use explicit "--" with checkout

Conflicts:
t/t9300-fast-import.sh

1  2 
fast-import.c
git-rebase--interactive.sh
git-rebase.sh
t/t9300-fast-import.sh
t/test-lib.sh

diff --cc fast-import.c
Simple merge
Simple merge
diff --cc git-rebase.sh
Simple merge
index 222d1059ef99879d3db387be798f973fb093f53e,385e78c22c0e00b9e81117a5ed7378298460c47b..986bc14d58c30201e75f3d95d9b8245e997b99e9
@@@ -898,27 -874,48 +898,69 @@@ test_expect_success 
         git diff-tree -C --find-copies-harder -r N4^ N4 >actual &&
         compare_diff_raw expect actual'
  
 +test_expect_success \
 +      'N: copy root directory by tree hash' \
 +      'cat >expect <<-\EOF &&
 +      :100755 000000 f1fb5da718392694d0076d677d6d0e364c79b0bc 0000000000000000000000000000000000000000 D      file3/newf
 +      :100644 000000 7123f7f44e39be127c5eb701e5968176ee9d78b1 0000000000000000000000000000000000000000 D      file3/oldf
 +      EOF
 +       root=$(git rev-parse refs/heads/branch^0^{tree}) &&
 +       cat >input <<-INPUT_END &&
 +      commit refs/heads/N6
 +      committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 +      data <<COMMIT
 +      copy root directory by tree hash
 +      COMMIT
 +
 +      from refs/heads/branch^0
 +      M 040000 $root ""
 +      INPUT_END
 +       git fast-import <input &&
 +       git diff-tree -C --find-copies-harder -r N4 N6 >actual &&
 +       compare_diff_raw expect actual'
 +
+ test_expect_success \
+       'N: delete directory by copying' \
+       'cat >expect <<-\EOF &&
+       OBJID
+       :100644 000000 OBJID OBJID D    foo/bar/qux
+       OBJID
+       :000000 100644 OBJID OBJID A    foo/bar/baz
+       :000000 100644 OBJID OBJID A    foo/bar/qux
+       EOF
+        empty_tree=$(git mktree </dev/null) &&
+        cat >input <<-INPUT_END &&
+       commit refs/heads/N-delete
+       committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
+       data <<COMMIT
+       collect data to be deleted
+       COMMIT
+       deleteall
+       M 100644 inline foo/bar/baz
+       data <<DATA_END
+       hello
+       DATA_END
+       C "foo/bar/baz" "foo/bar/qux"
+       C "foo/bar/baz" "foo/bar/quux/1"
+       C "foo/bar/baz" "foo/bar/quuux"
+       M 040000 $empty_tree foo/bar/quux
+       M 040000 $empty_tree foo/bar/quuux
+       commit refs/heads/N-delete
+       committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
+       data <<COMMIT
+       delete subdirectory
+       COMMIT
+       M 040000 $empty_tree foo/bar/qux
+       INPUT_END
+        git fast-import <input &&
+        git rev-list N-delete |
+               git diff-tree -r --stdin --root --always |
+               sed -e "s/$_x40/OBJID/g" >actual &&
+        test_cmp expect actual'
  test_expect_success \
        'N: modify copied tree' \
        'cat >expect <<-\EOF &&
diff --cc t/test-lib.sh
Simple merge