Merge branch 'jk/no-system-includes-in-dot-c'
[gitweb.git] / t / t5521-pull-options.sh
index ded8f98dbed9764744799f7b4bed0c51fc57a158..ccde8ba491e8f119dc48accf5c10f533bf74c2fd 100755 (executable)
@@ -77,6 +77,14 @@ test_expect_success 'git pull -q -v' '
        test_must_be_empty out &&
        test -s err)
 '
+test_expect_success 'git pull --cleanup errors early on invalid argument' '
+       mkdir clonedcleanup &&
+       (cd clonedcleanup && git init &&
+       test_must_fail git pull --cleanup invalid "../parent" >out 2>err &&
+       test_must_be_empty out &&
+       test -s err)
+'
+
 
 test_expect_success 'git pull --force' '
        mkdir clonedoldstyle &&
@@ -165,4 +173,49 @@ test_expect_success 'git pull --allow-unrelated-histories' '
        )
 '
 
+test_expect_success 'git pull does not add a sign-off line' '
+       test_when_finished "rm -fr src dst actual" &&
+       git init src &&
+       test_commit -C src one &&
+       git clone src dst &&
+       test_commit -C src two &&
+       git -C dst pull --no-ff &&
+       git -C dst show -s --pretty="format:%(trailers)" HEAD >actual &&
+       test_must_be_empty actual
+'
+
+test_expect_success 'git pull --no-signoff does not add sign-off line' '
+       test_when_finished "rm -fr src dst actual" &&
+       git init src &&
+       test_commit -C src one &&
+       git clone src dst &&
+       test_commit -C src two &&
+       git -C dst pull --no-signoff --no-ff &&
+       git -C dst show -s --pretty="format:%(trailers)" HEAD >actual &&
+       test_must_be_empty actual
+'
+
+test_expect_success 'git pull --signoff add a sign-off line' '
+       test_when_finished "rm -fr src dst expected actual" &&
+       echo "Signed-off-by: $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL>" >expected &&
+       git init src &&
+       test_commit -C src one &&
+       git clone src dst &&
+       test_commit -C src two &&
+       git -C dst pull --signoff --no-ff &&
+       git -C dst show -s --pretty="format:%(trailers)" HEAD >actual &&
+       test_cmp expected actual
+'
+
+test_expect_success 'git pull --no-signoff flag cancels --signoff flag' '
+       test_when_finished "rm -fr src dst actual" &&
+       git init src &&
+       test_commit -C src one &&
+       git clone src dst &&
+       test_commit -C src two &&
+       git -C dst pull --signoff --no-signoff --no-ff &&
+       git -C dst show -s --pretty="format:%(trailers)" HEAD >actual &&
+       test_must_be_empty actual
+'
+
 test_done